package com.kotlin.lib.clazz

import java.util.concurrent.locks.Lock
import java.util.concurrent.locks.ReentrantLock


private fun getXx(): String {
    basicMethod {
        return/*@basicMethod*/ it
    }
    return "a"
}

fun main() {
    println(getXx())
}

private inline fun basicMethod(body: (storage: String) -> Unit) {
    val kv = "compute kv"
    body(kv)
}


private inline fun method(lock: Lock, body: () -> Unit) {
    lock.lock()
    try {
//        callByInline(body)
        body()
    } catch (e: Exception) {

    } finally {
        lock.unlock()
    }
}

private fun callByInline(body: () -> Unit) {

}

private fun otherMethod() {
    method(ReentrantLock()) {
        println("i'm body")

    }
}